home *** CD-ROM | disk | FTP | other *** search
- /* bt_file.c - file I/O for BTREE module */
- #include "stdio.h"
- #include "cminor.h"
- #include "btree.h"
- #include "bt_macro.h"
-
- #define BOF_REL 0
- #define WR_MODE 1
- #define RW_MODE 2
-
- extern IX_DESC *pci ;
-
- int creat_if(fn) /* create a file */
- char fn[] ;
- {
- return( gcreat(fn,WR_MODE,BIN_MODE) ) ;
- }
-
- int read_if(start,buf,nrd)
- RECPOS start ;
- char buf[] ;
- int nrd ;
- {
- lseek(pci->ixfile,start,BOF_REL) ;
- return( read(pci->ixfile,buf,nrd) ) ;
- }
-
- int write_if(start,buf,nwrt)
- RECPOS start ;
- char buf[] ;
- int nwrt ;
- {
- lseek(pci->ixfile,start,BOF_REL) ;
- return( write(pci->ixfile,buf,nwrt) ) ;
- }
-
- int close_if() /* close an index file */
- {
- return( close(pci->ixfile) ) ;
- }
-
- int open_if(fn) /* open an index file */
- char fn[] ;
- {
- return( gopen(fn,RW_MODE,BIN_MODE) ) ;
- }
-
-
-